<?php

namespace pam\Factory;

/**
 * Description of ResearchControllerFactory
 *
 * @author Robert Bwana
 */

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use pam\Controller\ResearchController;

class ResearchControllerFactory implements FactoryInterface{
    public function createService(ServiceLocatorInterface $serviceLocator) {
        $policyLocator = $serviceLocator->getServiceLocator();

        $researchService = $policyLocator->get('pam\Service\ResearchService');
        $form = $policyLocator->get('FormElementManager')->get('pam\Form\ResearchForm');

        return new ResearchController($researchService, $form);
    }
}
